package com.tina.service.impl;

import com.tina.entity.Employee;
import com.tina.mapper.EmployeeMapper;
import com.tina.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 员工 Service 接口实现类
 * 开启事务
 *
 * @author Tina
 * @version 0.0.1
 * @date 2020/7/1 22:56
 **/
@Service
@Transactional
public class EmployeeServiceImpl implements EmployeeService {
    @Autowired
    private EmployeeMapper mapper;

    @Override
    public List<Employee> empList() {
        return mapper.empList();
    }

    @Override
    public Integer saveEmp(Employee emp) {
        return mapper.saveEmp(emp);
    }

    @Override
    public Integer delEmp(Integer empId) {
        return mapper.delEmp(empId);
    }

    @Override
    public Integer editEmp(Employee emp) {
        return mapper.editEmp(emp);
    }
}
